package followme.yaohuile.com.followme.adapter.recommend.destination;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.lidroid.xutils.BitmapUtils;

import java.util.List;

import followme.yaohuile.com.followme.R;
import followme.yaohuile.com.followme.bean.recommend.destination.CountryInfo;

/**
 * Created by Administrator on 15-11-14.
 */
public class OtherCountryAdapter extends BaseAdapter{
    List<CountryInfo> hotcountrylist;
    Context context;
    BitmapUtils bitmapUtils;
    public OtherCountryAdapter(Context context, List<CountryInfo> hotcountrylist, BitmapUtils bitmapUtils) {
        this.context = context;
        this.hotcountrylist = hotcountrylist;
        this.bitmapUtils = bitmapUtils;
    }

    @Override
    public int getCount() {
        return hotcountrylist.size();
    }

    @Override
    public Object getItem(int position) {
        return hotcountrylist.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        ViewHolder vh;
        if (convertView==null){
            vh = new ViewHolder();
            convertView = LayoutInflater.from(context).inflate(R.layout.othercountryitem,null);
            vh.catename_en = (TextView) convertView.findViewById(R.id.oth_catename_en);
            vh.catename = (TextView) convertView.findViewById(R.id.oth_catename);
            convertView.setTag(vh);
        }else{
            vh = (ViewHolder) convertView.getTag();

        }
        vh.catename_en.setText(hotcountrylist.get(position).getCatename());
        vh.catename.setText(hotcountrylist.get(position).getCatename_en());
        return convertView;
    }
    class ViewHolder{
        TextView catename;
        TextView catename_en;

    }
}


